package com.example.consumer.listeners;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaListener1 {

    @KafkaListener(topics = "test")
    public void consume1(ConsumerRecord record){
        Object key = record.key();
        Object value = record.value();

        int partition = record.partition();

        System.out.println("key:" + key);
        System.out.println("value:" + value);
        System.out.println("partition:" + partition);

        System.out.println("-------------------------");
    }
}
